/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ventana;

/**
 *
 * @author Fede
 */
import java.awt.Component;
import java.awt.Color;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class RenderFila2 extends DefaultTableCellRenderer {

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        
        Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

        System.out.println("fila: " + row);
        System.out.println("Columna:" + column);
        
        
        
        if (column == 0 && value != null) 
        {
            if (value.toString().compareTo("Fin atención vendedor 2") == 0) 
            {
                cell.setBackground(Color.GREEN);
            } 
            else 
            {
                if (value.toString().compareTo("Llegada Cliente") == 0)
                {
                    cell.setBackground(Color.ORANGE);
                }
                else
                {
                    if (value.toString().compareTo("Fin Reparto") == 0) 
                    {
                    cell.setBackground(new Color(0xFE899B));
                    } 
                    else
                    {
                        if (value.toString().compareTo("Fin atención vendedor 1") == 0) 
                        {
                            cell.setBackground(Color.PINK);
                        } 
                        else
                        {
                            cell.setBackground(Color.WHITE);
                        }
                    }
                }
            }
        }
        return cell ;
    }
}
